
bt.module({builder: function(bt) {

    var j$ = jQuery;

    j$(document).ready(function() {
        var qr_btns_event = function(_id) {
            var popup = j$(_id);
            var overlay = $("#overlay");
            popup.fadeIn();
            overlay.show();
            var windowWidth = document.documentElement.clientWidth;
            var windowHeight = document.documentElement.clientHeight;
            var popupHeight = popup.height();
            var popupWidth = popup.width();
            popup.css({
                "position": "fixed",
                "top": windowHeight / 2 - popupHeight / 2,
                "left": windowWidth / 2 - popupWidth / 2
            });
            overlay.one("click", function() {
                popup.fadeOut();
                overlay.hide();
            });
            popup.find(".close").one("click", function() {
                popup.fadeOut();
                overlay.hide();
            });
        };

        j$(".download-btns .ios-qr").click(function() {
            qr_btns_event("#ios-qr");
        });
        j$(".download-btns .android-qr").click(function() {
            qr_btns_event("#android-qr");
        });
    });

}});
